<?php defined('SYSPATH') OR die('No direct access allowed.');

class Buy_Controller extends Template_Controller 
{
	public $template = 'deals/buy';
	public $content = 'deals/buy_content';

	public function __construct()
	{
		parent::__construct();

		$this->session= Session::instance();
		$authentic=new Auth;
		if (!$authentic->logged_in())
		{
			$this->session->set("requested_url","/".url::current());
			url::redirect('/login');
		}
	}

	public function index()
	{
		url::redirect();
	}

	public function order($order_id)
	{
		$order = ORM::factory('order', $order_id);	
		if ($order->loaded == true)
		{
			$this->template->content->set("order", $order);
			return;
		}
		
		url::redirect();
	}
}
